﻿namespace Web.Control.Member.My.Settings
{
    using System;
    using System.Data;
    using System.Drawing;
    using System.Web;
    using System.Web.Security;
    using System.Web.UI.WebControls;
    using System.Web.UI.HtmlControls;
    using System.Text.RegularExpressions;
    using Lx.Web.Common.UI;
    using Lx.Web.Common.ControlsUI;
    using System.Collections;
    using System.IO;

    using Model.WWW_User.User;
    using BLF.WWW_User.Users;

    public class Notification : BaseControl
    {
        protected override void OnLoad(EventArgs e)
        {
            if (HttpContext.Current.User.Identity.Name == "")
            {
                Page.Response.Redirect(LoginHost + "/User/login.htm?ReturnUrl=" + Page.Request.Url.AbsoluteUri);
            }
       
            
                UserNotifiModel unm = User.GetUserNotifiInfo(HttpContext.Current.User.Identity.Name);
                if (unm == null) unm = new UserNotifiModel(HttpContext.Current.User.Identity.Name, 7, "1", DateTime.Now, DateTime.Now);
                Int32 emailVal = unm.EmailOption;
                
                String letterVal = unm.NotifyOption;
                Response.Write("<script>var MemberNo='" + HttpContext.Current.User.Identity.Name + "'");
                Response.Write(";var emailVal='" + emailVal + "' ");
                Response.Write(";var letterVal='" + letterVal + "' </script>");
               
            base.OnLoad(e);
        }
    }
}
